/********************************************************************************
 *      Copyright:  (C) Guo Zixuan
 *                  All rights reserved.
 *
 *       Filename:  parse_data.h
 *    Description:  This file 
 *
 *        Version:  1.0.0(17/05/25)
 *         Author:  Guo Zixuan <guozixuan@gmail.com>
 *      ChangeLog:  1, Release initial version on "17/05/25 16:55:43"
 *                 
 ********************************************************************************/
#ifndef PARSE_DATA_H
#define PARSE_DATA_H

#include <stdint.h>
#define CRC16_ITU_T_POLY 0x1021

typedef struct data_s
{
	char    sn[10];
	char    mytime[32];
	char    temp[10];
}data_t;


typedef int (* parse_proc_t)(uint8_t *buf, data_t *data);

int parse_data(uint8_t *buf, data_t *data);
int parse_data_json(uint8_t *buf, data_t *data);
int parse_data_tlv(uint8_t *buf, data_t *data);
static uint16_t crc_itu_t(const uint8_t *data, size_t length);

#endif

